package com.flick.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.hateoas.core.Relation;

import javax.persistence.*;

/**
 * Created by flick on 2017/4/27.
 */
@Entity
@Relation(value = "student", collectionRelation = "students")
public class Student extends AbstractEntity{

    private String name;
    private Integer age;
    private String sex;
    @ManyToOne
    @JsonIgnore
    @JoinColumn(name = "theclass_id", referencedColumnName = "id")
    private Theclass theclass;


    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "age")
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }


    public Theclass getTheclass() {
        return theclass;
    }

    public void setTheclass(Theclass theclass) {
        this.theclass = theclass;
    }
}
